package Graphics;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.FileInputStream;
import java.util.Properties;
/**
 *
 * @author relion65
 */
//TODO finish work on widget icons
//to be properly parsed and shown
//by widget engine.
public class WidgetIcon 
{
    private Properties settings;
    private BufferedImage im;
    public WidgetIcon(int height,int width,BufferedImage im,int id)
    {
        settings.put("Height",height);
        settings.put("Width",width);
        settings.put("ID",id);
        this.im = im;
    }
    public WidgetIcon(String dir,int id)throws Exception
    {
        FileInputStream fis = new FileInputStream(dir);
        im = ImageIO.read(fis);
        settings.put("Height",im.getHeight());
        settings.put("Width",im.getWidth());
        settings.put("ID",id);
    }
    public void setProps(Properties set)
    {
        this.settings = settings;
    }
    public Properties getSettings()
    {
        return settings;
    }
    public BufferedImage getImage()
    {
        return im;
    }
}
